package com.example.netactivity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

public class MyRecyclerActivity extends AppCompatActivity {
    ItemData[] itemData = new ItemData[]{
            new ItemData("Email",android.R.drawable.ic_dialog_email),
            new ItemData("Info",android.R.drawable.ic_dialog_info),
            new ItemData("Delete",android.R.drawable.ic_delete),
            new ItemData("Dialer",android.R.drawable.ic_dialog_dialer),
            new ItemData("Alert",android.R.drawable.ic_dialog_alert),
            new ItemData("Map",android.R.drawable.ic_dialog_map),
            new ItemData("Email",android.R.drawable.ic_dialog_email),
            new ItemData("Info",android.R.drawable.ic_dialog_info),
            new ItemData("Delete",android.R.drawable.ic_delete),
            new ItemData("Dialer",android.R.drawable.ic_dialog_dialer),
            new ItemData("Alert",android.R.drawable.ic_dialog_alert),
            new ItemData("Map",android.R.drawable.ic_dialog_map),
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_recycler);

        RecyclerView recyclerView = findViewById(R.id.recyclerview);
        MyRecyclerAdapter adapter = new MyRecyclerAdapter(itemData);
        recyclerView.setLayoutManager(new GridLayoutManager(this,2));
        recyclerView.setAdapter(adapter);

    }
}